﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserForm.ascx.cs" Inherits="WEB.APP.Controls.System.UserForm" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Store ID="storeRole" runat="server">
    <Reader>
        <ext:JsonReader IDProperty="RoleId">
            <Fields>
                <ext:RecordField Name="RoleId" />
                <ext:RecordField Name="RoleName" />
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>
<ext:Window ID="winDetails" runat="server" Title="Account Details" Frame="false"
    Hidden="true" CenterOnLoad="true" Width="400" Height="100" BodyStyle="padding:5px 5px 0px 5px;"
    Resizable="false" Closable="true" Layout="Fit" AutoHeight="true" Icon="Group" Modal="true">
    <Items>
        <ext:FormPanel ID="FormPanel1" runat="server" Header="false" LabelWidth="100" AutoHeight="true"
            Border="false" MonitorValid="true" BodyStyle="background-color:transparent;"
            Layout="FormLayout">
            <Items>
                <ext:Hidden ID="hdfUserName" runat="server" />
                <ext:Hidden ID="hdfPassword" runat="server" />
                <ext:TextField ID="txtUserName" runat="server" FieldLabel="Username" AnchorHorizontal="100%"
                    AllowBlank="false" BlankText="Không để trống" />
                <ext:TextField ID="txtPassword" runat="server" FieldLabel="Password" InputType="Password"
                    Anchor="100%" AllowBlank="false" BlankText="Không để trống" />
                <ext:TextField ID="txtConfirmPassword" runat="server" FieldLabel="Confirm Password" InputType="Password"
                    AnchorHorizontal="100%" Vtype="password" VtypeText="The entered passwords do not match."
                    AllowBlank="false" BlankText="Không để trống">
                    <CustomConfig>
                        <ext:ConfigItem Name="initialPassField" Value="#{txtPassword}" Mode="Value" />
                    </CustomConfig>
                </ext:TextField>
                <ext:ComboBox ID="cbbRole" runat="server" FieldLabel="Role" AnchorHorizontal="100%"
                    StoreID="storeRole" DisplayField="RoleName" ValueField="RoleId" AllowBlank="false"
                    BlankText="Không để trống" />
                <ext:CheckboxGroup ID="CheckboxGroup2" runat="server" FieldLabel="Active">
                    <Items>
                        <ext:Checkbox ID="ckbIsActive" runat="server" Checked="true" />
                    </Items>
                </ext:CheckboxGroup>
            </Items>
            <Listeners>
                <ClientValidation Handler="#{btnSave}.setDisabled(!valid);" />
            </Listeners>
        </ext:FormPanel>
    </Items>
    <Buttons>
        <ext:Button ID="btnSave" runat="server" Text="Save" Icon="Disk">
            <DirectEvents>
                <Click OnEvent="btnSave_Click" />
            </DirectEvents>
        </ext:Button>
        <ext:Button ID="btnCancel" runat="server" Text="Cancel" Icon="Cancel">
            <Listeners>
                <Click Handler="#{winDetails}.hide();" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>